package com.micromall.repository;

import com.micromall.repository.entity.Employee;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EmployeeMapper extends BaseMapper<Employee> {

	List<Employee> search(@Param("query") String query);

	@Update("UPDATE employee set times=(times + 1) where id=#{id}")
	int incrementTimes(@Param("id") int id);

	@Update("UPDATE employee set times=(times - 1) where id=#{id}")
	int decrementTimes(@Param("id") int id);
}